package com.item.yxlottery.yxlottery.activity;

/*
 *------------------------------
 * @创建者      Administrator
 * @创建时间    2017/1/5 09:31
 * @文件描述    彩票店评论
 *------------------------------
 */

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.item.yxlottery.yxlottery.R;
import com.item.yxlottery.yxlottery.adapter.StoreCommentsAdapter;
import com.item.yxlottery.yxlottery.base.BaseActivity;
import com.item.yxlottery.yxlottery.bean.StoreCommentBean;
import com.zhy.autolayout.AutoRelativeLayout;

import java.util.ArrayList;

import butterknife.Bind;
import butterknife.ButterKnife;

public class StoreCommentsActivity extends BaseActivity implements View.OnClickListener {

    @Bind(R.id.rv_storecomments_list)
    RecyclerView mRvList;

    private ArrayList<StoreCommentBean> mCommentList = new ArrayList<>();

    @Override
    protected void setCustomActionBar(ImageButton ibActionbarLeft, TextView tvActionBarTitle, ImageButton ibActionbarRight, AutoRelativeLayout layoutActionbar) {
        ibActionbarLeft.setImageResource(R.drawable.leftarrow);
        ibActionbarLeft.setOnClickListener(this);
        tvActionBarTitle.setText("评论");
        ibActionbarRight.setVisibility(View.GONE);
    }

    @Override
    protected View initView() {
        View view = View.inflate(this, R.layout.activity_storecomments, null);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    protected void initData() {
        String iconUrl = "http://img.51ztzj.com/upload/image/20140828/sj201408262012_279x419.jpg";
        for (int i = 0; i < 7; i++) {
            mCommentList.add(new StoreCommentBean(iconUrl,"name","3.5","2017.1.5 09:54","评论,评论,评论......"));
        }
        StoreCommentsAdapter commentsAdapter = new StoreCommentsAdapter(this, R.layout.item_storecomment_list, mCommentList);
        mRvList.setLayoutManager(new LinearLayoutManager(this));
        mRvList.setAdapter(commentsAdapter);
    }

    @Override
    protected void initEvent() {

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ib_actionbar_left:
                finish();
                break;
        }
    }
}
